package jnaex;

import com.sun.jna.Library;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.PointerByReference;
import com.sun.jna.ptr.IntByReference;

public interface IJnaExLib extends Library {
    void jnaex_free(Pointer pointer);
    int jnaex_call_with_cb(IJnaExCallback callback, String session, Pointer userdata);

    int jnaex_double(int val);
    void jnaex_sendstring(String str);
    void jnaex_getstring(PointerByReference ref);

    JnaExChars.ByValue jnaex_getchars();
    void jnaex_chars_free(JnaExChars.ByValue chars);

    void jnaex_sendstrings(JnaExStrings.ByReference ref);
    JnaExStrings.ByValue jnaex_getstrings();
    void jnaex_cleanstrs(JnaExStrings.ByValue jstrValue);
    void jnaex_sendstrarrfast(Pointer ptStrArr, int n);
    void jnaex_getstrarrfast(PointerByReference ptStrArrRef, IntByReference n);

    void jnaex_sendstruct(JnaExData.ByReference data);
    JnaExData.ByValue jnaex_getstruct();
    void jnaex_updatestruct(JnaExData.ByReference data);
    int jnaex_countstruct(JnaExData.ByReference data, int size);
    int jnaex_getstructarr(PointerByReference ptData, IntByReference size);
    double jnaex_senddoublearr(Pointer ptr, int n);
    int jnaex_getdoublearr(PointerByReference ptr, IntByReference n);

    double jnaex_senddoublestruct(JnaExDouble.ByReference ds);
    JnaExDouble.ByValue jnaex_getdoublestruct();

    void jnaex_senddatalist(JnaExDataList.ByReference datalist);
    JnaExDataList jnaex_getdatalist();
    void jnaex_data_list_free(JnaExDataList.ByValue datalist);
}
